<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js练习</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body {
            font-size: 14px;
            font-family: Arial, 微软雅黑, 宋体;
            text-size-adjust: none;
            color: rgb(79, 111, 125);
            margin: 0px;
            padding: 0px;
            background: rgb(246, 246, 246);
        }
        .top{
            background: #fff;
            padding: 20px;
            margin: 20px auto;
            width: 82%;
            height: 100px;
            line-height: 22px;
            border-bottom: 9px solid #E7EFF1;
            box-shadow: 1px 0px 5px rgba(100, 100, 100, 0.3);
            font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
        }
        a{
            text-decoration: none;
            cursor: pointer;
            outline: none;
            color: #7698A7;
            font-weight: 500;
        }
        h1{
            font-family: inherit;
            font-size: 25px;
        }
        .top-right{
            float: right;
        }
        .two{
            border-color: #e8f3ec;
            background: #fff;
            padding: 20px;
            margin: 20px auto;
            width: 82%;
            line-height: 22px;
            border-bottom: 9px solid #E7EFF1;
            box-shadow: 1px 0px 5px rgba(100, 100, 100, 0.3);
        }
        p{
            margin: 20px 5%;
            width: 82%;
            color: #919191;
        }
        .two-btn{
            font-size: 18px;
            background-color: #337ab7;
            border-color: #2e6da4;
            padding: 10px 16px;
            border-radius: 6px;
            cursor: pointer;
        }

    </style>
</head>
<body>
<div class="top">
    <h1><a class="top-a" href="#">JAVAscript练习</a></h1>
    <a class="top-right" href="#">
        <img src="//pub.idqqimg.com/wpa/images/group.png" alt="">
    </a>
</div>
<div class="two">
    1.说明事件<br>
    <p class="two-p"><button class="two-btn">按钮</button></p>
</div>
<script>
    var btn1=document.getElementsByClassName("two-btn");
    btn1.addEventListener("click" ,function () {
        alert("弹出窗口")
    });

</script>
</body>
</html>